package com.bjc.feign;

import com.bjc.domain.Product;
import com.bjc.feign.fallback.ProductServiceFallback;
import com.bjc.feign.fallback.ProductServiceFallbackFactory;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;

/**
 * @program: spring-cloud-alibaba
 * @description: feign
 * @author: bjc
 * @create: 2021-07-30 21:09
 */
@FeignClient(value = "service-product",
//用上面这个就不用下面这个，用下面这个就不用上面这个
//        fallback = ProductServiceFallback.class,
        fallbackFactory = ProductServiceFallbackFactory.class
)
public interface ProductFeignClient {

    @RequestMapping("/product/{pid}")
    Product findByPid(@PathVariable("pid") Integer pid);
}
